#!/bin/bash

if [ -z "$MY_INCLUDE_LOG_SH" ]; then
    export MY_INCLUDE_LOG_SH=1
else
    return
fi

function _log()
{
    echo $(basename ${BASH_SOURCE[2]}) ${BASH_LINENO[1]} ${FUNCNAME[2]}: $*
}

function logi()
{
    _log $*
}

function logw()
{
    _log $*
}

function loge()
{
    _log $*
}

function log_param_len()
{
    range_left=$1
    range_right=$2
    length=$3
    if [ $range_left -le $length -a $length -le $range_right ]; then
        return 0
    fi

    loge "need [$range_left, $range_right] parameter(s), now have $length"
}
